package org.xp.judgeplatform.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("user")
@Schema(description = "用户实体")
public class User {
    public static final String ROLE_USER = "USER";
    public static final String ROLE_ADMIN = "ADMIN";

    public static final String STATUS_NORMAL = "NORMAL";
    public static final String STATUS_BANNED = "BANNED";

    @TableId(type = IdType.AUTO)

    @Schema(description = "用户Id", example = "1")
    private Integer id;

    @Schema(description = "用户名", example = "testuser")
    private String username;

    @Schema(description = "密码", hidden = true)
    private String password;

    @Schema(description = "邮箱", example = "user@example.com")
    private String email;

    @Schema(description = "手机号", example = "13812345678")
    private String phone;

    @Schema(description = "头像", example = "https://example.com/avatar.jpg")
    private String avatar;

    @Schema(description = "个人简介", example = "我是一名程序员")
    private String intro;

    @Schema(description = "角色", example = "USER", allowableValues = {"USER", "ADMIN"})
    private String role;

    @Schema(description = "状态", example = "NORMAL", allowableValues = {"NORMAL", "BANNED"})
    private String status;

    @Schema(description = "创建时间")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;
}
